package com.pwl.springBoot.modules.test.dao;

import com.pwl.springBoot.modules.test.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface StudentDao extends JpaRepository<Student,Integer> {
    List<Student> findByStudentName(String studentName);

    @Modifying
//	@Query(nativeQuery = true, value = "update test_student set student_name = :#{#student.studentName} " +
//			"where id = :#{#student.id}")
    @Query(value = "update Student set studentName = :#{#student.studentName} " +
            "where id = :#{#student.id}")
    void updateStudent(@Param("student") Student student);
}
